package com.simple.slider.puzzle;

import android.os.Parcel;
import android.os.Parcelable;


public class SliderTile implements Parcelable {
	private static final String LOG_TAG = SliderTile.class.getName();
	
	private int tileNum;
	private int rowNum;
	private int colNum;
	
    public SliderTile(int tnum, int row, int col) {		
		tileNum = tnum;
		rowNum = row;
		colNum = col;
	}
    
    private SliderTile(Parcel in) {
    	tileNum = in.readInt();
		rowNum = in.readInt();
		colNum = in.readInt();
    }
    
    public static final Parcelable.Creator<SliderTile> CREATOR = new Parcelable.Creator<SliderTile>() {
        public SliderTile createFromParcel(Parcel in) {
            return new SliderTile(in);
        }
        
        public SliderTile[] newArray(int size) {
            return new SliderTile[size];
        }
    };
        
    public int num() {
    	return tileNum;
    }
    
    public int row() {
    	return rowNum;
    }
    
    public int col() {
    	return colNum;
    }
    
    public void setRC(int row, int col) {
    	rowNum = row;
    	colNum = col;
    }
    
    public void setRow(int row) {
    	rowNum = row;
    }
    
    public void setCol(int col) {
    	colNum = col;
    }

	@Override
	public int describeContents() {
		
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(tileNum);
		dest.writeInt(rowNum);
		dest.writeInt(colNum);
	}
}
